/* GUI CONVERTED from rspomtb3.p (converter v1.75) Sat Aug 12 23:14:47 2000 */
/* rspomtb3.p - Supplier Scheduled Order Sub Program                        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.             */
/*V8:ConvertMode=Maintenance                                                */
/*V8:WebEnabled=No                                                          */
/* REVISION: 9.0    CREATED: 10/28/98           BY: *K1QZ* Suresh Nayak     */
/* REVISION: 9.0   MODIFIED: 03/13/99           BY: *M0BD* Alfred Tan       */
/* REVISION: 9.1   MODIFIED: 08/12/00           BY: *N0KP* myb              */


/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */
/*         THIS PROGRAM IS A BOLT-ON TO STANDARD PRODUCT MFG/PRO.           */
/* ANY CHANGES TO THIS PROGRAM MUST BE PLACED ON A SEPARATE ECO THAN        */
/* STANDARD PRODUCT CHANGES.  FAILURE TO DO THIS CAUSES THE BOLT-ON CODE TO */
/* BE COMBINED WITH STANDARD PRODUCT AND RESULTS IN PATCH DELIVERY FAILURES.*/
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */


         /*DISPLAY TITLE */
         {mfdeclre.i}

/* **************** Begin Translatable Strings Definitions **************** */


/* ***************** End Translatable Strings Definitions ***************** */


         define input parameter pod_recid as recid no-undo.
         define variable l_yn as logical no-undo.


         for first pod_det where recid(pod_det) = pod_recid
         exclusive-lock: end.

         l_yn = yes.
         do on error  undo, retry
            on endkey undo, leave:
/*GUI*/ if global-beam-me-up then undo, leave.


            if pod_plan_days = 0 and pod_plan_weeks = 0 and pod_plan_mths = 0
            then do:

              /* SCHEDULE DAYS, SCHEDULE WEEKS AND SCHEDULE MONTHS CANNOT */
              /* BE ZERO                                                  */
              {mfmsg.i 4373 3}
              return "pod_plan_days":U .
            end.

            if pod__qad05 and pod_plan_days = 0 then
            do:

            /* SCHEDULE DAYS CANNOT BE 0 WHEN GENERATING SHIPPING SCHEDULES. */
              {mfmsg.i 4371 3}
              return "pod_plan_days":U .
            end. /* END OF IF pod__qad05 and pod_plan_days */

            if pod_plan_weeks = 0 then
            do:
              /* PLANNING WEEKS ENTERED AS 0 */
              {mfmsg.i 4369 2}
              {mfmsg01.i 8500 2 l_yn}
              if not(l_yn) then
              return "pod_plan_weeks":U .
            end.

            if pod_plan_mths = 0
            then do:
              /* PLANNING MONTHS ENTERED AS 0. */
              {mfmsg.i 4370 2}
              {mfmsg01.i 8500 2 l_yn}
              if not(l_yn) then
              return "pod_plan_mths":U .
            end. /* END OF IF pod__qad12  */

            /* IT IS ASSUMED HERE THAT THERE ARE 30 DAYS IN A MONTH */
            if pod_plan_days > pod_plan_weeks * 7 + pod_plan_mths * 30
            then do:
               /* Shipping Schedule Days > Planning Schedule Weeks
                                            +  Planning Schedule Months. */
               {mfmsg.i 4375 2}
               {mfmsg01.i 8500 2 l_yn}
               if not(l_yn) then
               return "pod_plan_days":U .
            end.
         end.
/*GUI*/ if global-beam-me-up then undo, leave.

